package com.tv.cms.deviceInfo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.tv.cms.deviceInfo.mapper.DeviceInfoMapper;
import com.tv.cms.deviceInfo.model.DeviceInfo;
import com.tv.cms.deviceInfo.service.DeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * TODO
 *
 * @author
 * @date
 **/
@Service
public class DeviceInfoServiceImpl extends MPJBaseServiceImpl<DeviceInfoMapper, DeviceInfo> implements DeviceInfoService {
    @Autowired
    private DeviceInfoMapper baseMapper;
    @Override
    public Page<DeviceInfo> selectPageList(Page<DeviceInfo> objectPage, MPJLambdaWrapper<DeviceInfo> wrapper) {
        return baseMapper.selectPageList(objectPage, wrapper);
    }

    @Override
    public boolean updateStatus(DeviceInfo deviceInfo) {
        return baseMapper.updateStatus(deviceInfo);
    }

    @Override
    public List<DeviceInfo> selectDataList(MPJLambdaWrapper<DeviceInfo> wrapper) {
        return baseMapper.selectDataList( wrapper);
    }
    @Override
    public DeviceInfo getDataById(Integer id) {
        return baseMapper.getById(id);
    }

    @Override
    public boolean insert(DeviceInfo deviceInfo) {
        return baseMapper.insertModel(deviceInfo) > 0;
    }

    @Override
    public int selectCount(LambdaQueryWrapper<DeviceInfo> wrapper) {
        return baseMapper.count( wrapper);
    }

    @Override
    public boolean updateDeviceStatus(DeviceInfo deviceInfo) {
        return baseMapper.updateDeviceStatus(deviceInfo) > 0;
    }

    @Override
    public boolean update(DeviceInfo deviceInfo) {
        return baseMapper.update(deviceInfo) > 0;
    }
}
